<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page trimDirectiveWhitespaces="true" %>
<%@ page import="mfuny.ggongal.admin.http.HttpUserWeb" %>
<%@ page import="java.util.HashMap" %>
<%@ page import="org.json.simple.*" %>
<%@ page import="mfuny.ggongal.admin.json.JsonCreater" %>
<%@ page import="mfuny.ggongal.admin.debug.Debug" %>
<%
request.setCharacterEncoding( "utf-8" );
response.setContentType( "text/html; charset=utf-8" );

JsonCreater jc = new JsonCreater();
HttpUserWeb web = new HttpUserWeb();
String tag = request.getParameter( "tag" );
JSONObject json = new JSONObject();

//오늘의 경품게임 정보 가져오기.
if( tag.equals("web_specialToday")) {
	try{
		json = web.web_specialToday();
		out.print(json.toJSONString());
	}catch(Exception e) {
		Debug.toDebugFile(e, tag);
		json.put("responseCode", -1);
		json.put("error", e);
		out.print(json.toJSONString());
	}
}

//랭킹 가져오기.
else if( tag.equals("web_getRank")) {
	try{
		int ad_no = Integer.parseInt(request.getParameter("ad_no"));
		String day = request.getParameter("day");
		String hour = request.getParameter("hour");
		String callback = request.getParameter("callback");
		String result = web.web_getRank(ad_no, day, hour, callback);
		out.print(result);
	}catch(Exception e){
		Debug.toDebugFile(e, tag);
		json.put("responseCode", -1);
		json.put("error", e);
		out.print(json.toJSONString());
	}
}

//특정 유저 랭킹 검색.
else if( tag.equals("web_getMyRank")) {
	try{
		String id = request.getParameter("id");
		int ad_no = Integer.parseInt(request.getParameter("ad_no"));
		String day = request.getParameter("day");
		String hour = request.getParameter("hour");
		String callback = request.getParameter("callback");
		String result = web.web_getMyRank(id, ad_no, day, hour, callback);
		out.print(result);
	}catch(Exception e){
		Debug.toDebugFile(e, tag);
		json.put("responseCode", -1);
		json.put("error", e);
		out.print(json.toJSONString());
	}
}
%>



























